\(\int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx\) [67]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 24 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=-\frac {4 \text {arctanh}(\cos (a+b x))}{b}+\frac {4 \cos (a+b x)}{b} \]

[Out]

-4*arctanh(cos(b*x+a))/b+4*cos(b*x+a)/b

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4373, 2672, 327, 212} \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {4 \cos (a+b x)}{b}-\frac {4 \text {arctanh}(\cos (a+b x))}{b} \]

[In]

Int[Csc[a + b*x]^3*Sin[2*a + 2*b*x]^2,x]

[Out]

(-4*ArcTanh[Cos[a + b*x]])/b + (4*Cos[a + b*x])/b

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = 4 \int \cos (a+b x) \cot (a+b x) \, dx \\ & = -\frac {4 \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (a+b x)\right )}{b} \\ & = \frac {4 \cos (a+b x)}{b}-\frac {4 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {4 \text {arctanh}(\cos (a+b x))}{b}+\frac {4 \cos (a+b x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.83 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=4 \left (\frac {\cos (a+b x)}{b}-\frac {\log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{b}+\frac {\log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b}\right ) \]

[In]

Integrate[Csc[a + b*x]^3*Sin[2*a + 2*b*x]^2,x]

[Out]

4*(Cos[a + b*x]/b - Log[Cos[(a + b*x)/2]]/b + Log[Sin[(a + b*x)/2]]/b)

Maple [A] (verified)

Time = 2.03 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21

method result size
default \(\frac {4 \cos \left (x b +a \right )+4 \ln \left (\csc \left (x b +a \right )-\cot \left (x b +a \right )\right )}{b}\) \(29\)
risch \(\frac {2 \,{\mathrm e}^{i \left (x b +a \right )}}{b}+\frac {2 \,{\mathrm e}^{-i \left (x b +a \right )}}{b}+\frac {4 \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b}-\frac {4 \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{b}\) \(64\)

[In]

int(csc(b*x+a)^3*sin(2*b*x+2*a)^2,x,method=_RETURNVERBOSE)

[Out]

4/b*(cos(b*x+a)+ln(csc(b*x+a)-cot(b*x+a)))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.58 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {2 \, {\left (2 \, \cos \left (b x + a\right ) - \log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right )\right )}}{b} \]

[In]

integrate(csc(b*x+a)^3*sin(2*b*x+2*a)^2,x, algorithm="fricas")

[Out]

2*(2*cos(b*x + a) - log(1/2*cos(b*x + a) + 1/2) + log(-1/2*cos(b*x + a) + 1/2))/b

Sympy [F(-1)]

Timed out. \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=\text {Timed out} \]

[In]

integrate(csc(b*x+a)**3*sin(2*b*x+2*a)**2,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (24) = 48\).

Time = 0.22 (sec) , antiderivative size = 92, normalized size of antiderivative = 3.83 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {2 \, {\left (2 \, \cos \left (b x + a\right ) - \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) + \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right )\right )}}{b} \]

[In]

integrate(csc(b*x+a)^3*sin(2*b*x+2*a)^2,x, algorithm="maxima")

[Out]

2*(2*cos(b*x + a) - log(cos(b*x)^2 + 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(a) + sin(a)^2)
 + log(cos(b*x)^2 - 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(a) + sin(a)^2))/b

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (24) = 48\).

Time = 0.32 (sec) , antiderivative size = 54, normalized size of antiderivative = 2.25 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=-\frac {2 \, {\left (\frac {4}{\frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1} - 1} - \log \left (-\frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1}\right )\right )}}{b} \]

[In]

integrate(csc(b*x+a)^3*sin(2*b*x+2*a)^2,x, algorithm="giac")

[Out]

-2*(4/((cos(b*x + a) - 1)/(cos(b*x + a) + 1) - 1) - log(-(cos(b*x + a) - 1)/(cos(b*x + a) + 1)))/b

Mupad [B] (verification not implemented)

Time = 21.14 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \csc ^3(a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {4\,\cos \left (a+b\,x\right )-4\,\mathrm {atanh}\left (\cos \left (a+b\,x\right )\right )}{b} \]

[In]

int(sin(2*a + 2*b*x)^2/sin(a + b*x)^3,x)

[Out]

(4*cos(a + b*x) - 4*atanh(cos(a + b*x)))/b